package pe.gob.foncodes.ssa.bs.common.dao;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.hibernate.Session;
import org.hibernate.criterion.MatchMode;
import org.springframework.orm.jpa.JpaTemplate;
import pe.gob.foncodes.ssa.bs.common.util.DaoException;

public interface GenericDao {

    public abstract Map getFieldSearchConfig();

    public abstract MatchMode getMatchMode();

    public abstract void setMatchMode(MatchMode matchMode);

    public abstract void setFieldSearchConfig(Map fieldSearchConfig);

    public abstract Connection getConnection() throws DaoException;

    public abstract void delete(Object persistentInstance) throws DaoException;

    public abstract Object getReference(Class clazz, Serializable id) throws DaoException;

    public abstract void refresh(Object object) throws DaoException;

    public abstract void deleteById(Class clazz, Serializable id) throws DaoException;

    public abstract void delete(Collection collection) throws DaoException;

    public abstract boolean exists(Class clazz, String id) throws DaoException;

    public abstract Object findById(Class clazz, Serializable id) throws DaoException;

    public abstract Object findByCode(Class clazz, String c) throws DaoException;

    public abstract Object findGeneralByCode(Class clazz, String c) throws DaoException;

    public abstract List findByObject(Object object) throws DaoException;

    public abstract Date getCurrentDate() throws DaoException;

    public abstract JpaTemplate getJpaTemplate() throws DaoException;

    public abstract List findByNamedQuery(String queryName) throws DaoException;

    public Object findByNamedQueryUniqueRow(String queryName, Object[] values) throws DaoException;

    public abstract List findByNamedQuery(String queryName, Object[] values) throws DaoException;

    public abstract List findByNamedQuery(String queryName, Map<String, ?> params) throws DaoException;

    public abstract Integer executeUpdate(String queryName, Object[] values) throws DaoException;

    public List createNativeQuery(String queryName, Class clase) throws DaoException;

    public Object createNativeQuery(String queryName) throws DaoException;

    public List createNativeQuery(String queryName, Object[] values) throws DaoException;

    public abstract void initialize(Object object) throws DaoException;

    public abstract void initializeCollection(Collection collection) throws DaoException;

    public abstract Object save(Object object) throws DaoException;

    public abstract void persist(Object object) throws DaoException;

    public abstract void saveCollection(Collection collection) throws DaoException;

    public String getIdFieldName(Class clazz) throws DaoException;

    public List find(String queryName) throws DaoException;

    public abstract void flush() throws DaoException;

    public abstract List findByObjectDif(String clase, String campo, String valor, Long idObj) throws DaoException;

    public Session getSession() throws DaoException;

    public boolean actualizaEnCascada(Long id, String flgActivo, String nombreProcedure) throws DaoException, Exception;

    public boolean agregaEnCascada(Long idOpcion, Long idAccion, Long idCtrlWeb, String flgActivo, String nombreProcedure) throws DaoException, Exception ;
    
    public List<Long> getModulosHijos(Long nidModulo) throws DaoException;
    
    public boolean validaExistenciaEnPerfilOAutorizacion(Long nid, Long nidOpcion, String sTipo) throws DaoException;
    
    public List<Object[]> reporteOpcionxModulo(Long nidModulo, Long nidPerfil, String codUsuario) throws DaoException, Exception;
    
    public boolean actualizaPerfilOpcionEnCascada(Long idPerfil, Long idOpcion, String flgConsulta, String flgActivo, Long idCtrlWeb, String nombreProcedure) throws DaoException, Exception;
    
}
